/**   
* @Title: OrderController.java
* @Package me.cloud
* @Description: TODO
* @author xaoyaoyao
* @date 2018年12月5日 上午9:11:02
* @version V1.0   
*/
package me.cloud;

import java.util.Arrays;
import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: OrderController
 * @Description: TODO
 * @author xaoyaoyao
 * @date 2018年12月5日 上午9:11:02
 * 
 */
@RestController
@RequestMapping("/v1/order")
public class OrderController {

	@GetMapping("/list")
	public List<Order> getList() {
		Order order1 = new Order(10001, "测试订单-1", 100.00d);
		Order order2 = new Order(10002, "测试订单-2", 99.00d);
		return Arrays.asList(order1, order2);
	}

	@PostMapping("/addOrder")
	@ResponseBody
	public Order addOrder(@RequestBody Order order) {
		return order;
	}
}
